import request from '@/utils/request'

export function login(data) {
  return request({
    // url: '/vue-element-admin/user/login',
    url: '/modules/admin/login',
    method: 'post',
    data
  })
}
export function codelogin(data) {
  return request({
    url: '/modules/admin/qrlogin',
    method: 'post',
    data
  })
}
export function loanSwitch(data) {
  return request({
    url: '/modules/channel/loanSwitch',
    method: 'post',
    data
  })
}
export function couponSwitch(data) {
  return request({
    url: '/modules/channel/couponSwitch',
    method: 'post',
    params: data
  })
}

export function protocolSwitch(data) {
  return request({
    url: '/modules/channel/protocolSwitch',
    method: 'post',
    params: data
  })
}
export function getInfo(token) {
  return request({
    url: '/modules/admin/getCurrentUser',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/modules/admin/logout',
    method: 'post'
  })
}

export function getUserList(listQuery) {
  return request({
    url: '/modules/admin/getList',
    method: 'get',
    params: listQuery
  })
}

export function addUser(data) {
  return request({
    url: '/modules/admin/add',
    method: 'post',
    data
    // 上面的data就直接都用data，不需要在这里转成对应的实体类名（前面转就好）
  })
}

export function edit(data) {
  return request({
    url: '/modules/admin/edit',
    method: 'post',
    data
    // 上面的data就直接都用data，不需要在这里转成对应的实体类名（前面转就好）
  })
}

export function deleteAdmin(data) {
  return request({
    url: '/modules/admin/deleteAdmin',
    method: 'get',
    params: data
  })
}

export function editPassword(data) {
  return request({
    url: '/modules/admin/editPassword',
    method: 'post',
    data
    // 上面的data就直接都用data，不需要在这里转成对应的实体类名（前面转就好）
  })
}

export function addrole(data) {
  return request({
    url: '/modules/admin-role/addRole',
    method: 'post',
    data
    // 上面的data就直接都用data，不需要在这里转成对应的实体类名（前面转就好）
  })
}



// 手机用户接口
export function getPhoneUserList(data) {
  return request({
    url: '/modules/admin-user/getUserList',
    method: 'post',
    data
  })
}
// 手机筛选用户接口
export function getUserFilterList(data) {
  return request({
    url: '/modules/admin-user/getUserFilterList',
    method: 'post',
    data
  })
}
// 用户详情
export function getPhoneUserDetail(data) {
  return request({
    url: '/api/getUserData',
    method: 'get',
    params: data
  })
}
// 上送数据
export function pushData(data) {
  return request({
    url: '/modules/loan-push/PushData',
    method: 'get',
    params: data
  })
}
// 渠道下拉数据
export function getChannelIdAndNick(data) {
  return request({
    url: '/modules/channel/getChannelIdAndNick',
    method: 'get',
    params: data
  })
}
// 平台下拉数据
export function getplatformIdAndNick(data) {
  return request({
    url: '/api/platforms',
    method: 'get',
    params: data
  })
}
// 上送数据列表
export function pushDataList(data) {
  return request({
    url: '/modules/loan-push/getPushList',
    method: 'post',
    data
  })
}
// 上送数据报表
export function pushReport(data) {
  return request({
    url: '/modules/loan-push/getPushReportList',
    method: 'post',
    data
  })
}
// 渠道切换版本
export function changeVersion(data) {
  return request({
    url: '/api/channel/updateChannelVersion',
    method: 'post',
    data
  })
}
// 渠道切换版本
export function getPers() {
  return request({
    url: '/api/menu/myRoute',
    method: 'get'
  })
}
// 查询手机号
export function phoneQuery(data) {
  return request({
    url: '/modules/admin-order/selectPhone',
    method: 'post',
    data
  })
}

// getLoanAppFilterList
export function getLoanAppFilterList() {
  return request({
    url: '/modules/loanAppFilter/getLoanAppFilterList',
    method: 'get'
  })
}
// updateLoanAppFilter
export function updateLoanAppFilter(data) {
  return request({
    url: '/modules/loanAppFilter/updateLoanAppFilter',
    method: 'post',
    data
  })
}
// createFilter
export function createFilter(data) {
  return request({
    url: '/modules/loanAppFilter/create',
    method: 'post',
    data
  })
}
// 三方贷款用户
export function telesalesLoan(data) {
  return request({
    url: '/api/telesales/userLoan/list',
    method: 'post',
    data
  })
}
// 详情
export function userInfoDetail(data) {
  return request({
    url: '/api/telesales/userInfoDetail',
    method: 'post',
    data
  })
}
// 用户详情保存
export function saveUserInfotrack(data) {
  return request({
    url: '/api/telesales/add/telsalesOrder',
    method: 'POST',
    data
  })
}
// 订单认证
export function orderAuth(data) {
  return request({
    url: '/api/telesales/orderAuth/list',
    method: 'POST',
    data
  })
}
// 订单认证
export function userAuth(data) {
  return request({
    url: '/api/telesales/userAuth/list',
    method: 'POST',
    data
  })
}
// 三方贷款订单
export function orderLoan(data) {
  return request({
    url: '/api/telesales/orderLoan/list',
    method: 'POST',
    data
  })
}
// 导出
export function exportUserInfo(data) {
  return request({
    url: '/api/telesales/exportUserInfo',
    method: 'POST',
    params: data
  })
}
// listCyOrder
export function listCyOrder(data) {
  return request({
    url: '/chuangying/listCyOrder',
    method: 'POST',
    data
  })
}
// listCyPlan
export function listCyPlan(data) {
  return request({
    url: '/chuangying/listCyPlan',
    method: 'POST',
    data
  })
}
// getDetail
export function getDetail(data) {
  return request({
    url: '/chuangying/getDetail',
    method: 'GET',
    params: data
  })
}
// listCyReFlow
export function listCyReFlow(data) {
  return request({
    url: '/chuangying/listCyReFlow',
    method: 'POST',
    data
  })
}
// listCyUser
export function listCyUser(data) {
  return request({
    url: '/chuangying/listCyUser',
    method: 'POST',
    data
  })
}
// selectPhone
export function selectPhone(data) {
  return request({
    url: '/power/water/selectPhone',
    method: 'get',
    params: data
  })
}
// 查询用户列表
export function getPhone(data) {
  return request({
    url: '/modules/admin-user/get-user-by-phone',
    method: 'get',
    params: data
  })
}
// 解绑银行卡
export function unBundle(data) {
  return request({
    url: '/modules/admin-user/unbind-by-user-id',
    method: 'get',
    params: data
  })
}
// 删除用户
export function deleteUse(data) {
  return request({
    url: '/modules/admin-user/del-user-by-id',
    method: 'get',
    params: data
  })
}

